home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Design
/
WB Collection.iso
/
workbench werkzeuge
/
scherz programme
/
fortune
/
read_me_too
< prev
next >
Wrap
Text File
|
1996-04-07
|
5KB
|
136 lines
Jim Finnis
5 Northgate St.
Aberystwyth
Dyfed
SY23 2JS
email: white@elf.dircon.co.uk
First, a word of abject apology for those of you who have
written to me, and had to wait an utterly ridiculous amount of time for
your disk - I've been moving around a lot since last year, and it's
taken almost a year for some of the post sent to my old address to
finally catch up with me. Some of you may have sent me a disk and NEVER
heard from me.. that's because the forwarding addresses have got
mangled, lost, etc.. Once again, sorry.
The current number of fortunes is almost 4000, mainly thanks to
Grahame Fendle, who sent me about a hundred quotes of his own, and Mike
Carlin of MVM Consultants, who sent me six hundred and thirty. Grahame
later followed up with another two-hundred-ish quotes. Thanks! I think it
must be a contender for the biggest fortune program in history by now.
Here are some commonly asked questions:
1) How can I add to an existing fortune file?
Phew - this is a tough one, and I'm afraid to say you can't. The
reason is that the file is in several sections:
Huffman compression table, giving the relative frequencies of all
the different characters used in the file,
File statistics (such as the total number of fortunes),
A table of pointers to the beginning of each fortune,
Each fortune itself, compressed according to the compression tables
at the beginning.
I've thought about this a lot, and it's impossible to join two
compressed files together without decompressing them first, and rehashing
all the compression data, and building a new, bigger jump table. In other
words, the program would have to generate the original source files itself.
And since you have them already, this is a bit pointless. Sorry, but using
the jump table method makes it infinitely faster.
What I normally do is keep an ASCII file called "newforts", and add
new fortunes to this as they occur to me. When this is fairly large (about
100 fortunes), I add this file onto the end of the main fortune text file,
and run makefort. That way, I don't run makefort every time I think of a
fortune. Incidentally, makefort is faster now!
2) If I put fortune in my startup-sequence, it keeps showing the same
fortune every time I boot.
Ah, this is because you don't have a RAM expansion with a battery
backed-up clock! Fortune decides which fortune to show by generating a
random number. Since computers can't really do random numbers, it needs a
pseudo-random source to work from. The only available one is the time -
which on the Amiga is in seconds since midnight on the 1st of January 1970
(Incidentally, this is when my girlfriend was born, and "Amiga" means
"girlfriend" in Spanish - spooky, huh?). Of course, on machines which don't
have a clock, the time is always the same whenever you switch on - it
starts at 0 Since it usually takes the same time to run a startup-sequence,
the clock is always the same every time it prints a fortune, so you always
get the same one! It works fine when you run it any other way, because in
typing the command, or clicking on it, you have a random delay.
There's no real way around this, except by putting in some piece of
user interaction to act as the random delay. You can do this by starting up
fortune with the -i flag, or by putting the line
ask "Press return for a fortune"
in the startup-sequence before the line running the fortune program.
If you do have a battery backed-up clock, and still have this
problem, make sure that fortune knows what the time is by ensuring that the
"fortune" line in the startup-sequence is after the "setclock load" line,
which reads the clock.
3) Did I type them all in?
No way! The fortune file you have is from various places, where it
grew over a period of many years. About half of them are from the "original"
fortune file found on most UNIX mainframes and minicomputers. I extracted them
from the Tardis Project machine at Edinburgh University, but only got up to
those beginning with 'N' when the file transfer failed! The rest are either
from the worldwide Unix News system Usenet's "rec.humor.funny" and
"alt.humor.oracularities" newsgroups, or from my own personal collection
of stuff. I hope you enjoy them.
4) Can I have the source?
I would have liked to supply the source, but there isn't enough room
on the disk - such is life. Besides, it's not the prettiest of programs -
like most pet projects, it grew organically. It's even got a "goto" in it.
STOP PRESS: I've changed my mind! The source is now on the disk.
See fortune.notes to see what's what.
Begging Bit
-----------
This is the full version of the program, with all the
features below. If you send me a fiver, however, I'll be eternally
grateful.. Nobody has yet, though...
Stop Press!
The program is updated! It now has icons, which allow you to move
through the file backwards and forwards, and to jump to a random fortune.
There's a new flag, FLAGS=TINY, which makes the iconised form of the window
just big enough to hold these icons. In addition, the program has a built
in clock, memory monitor and alarm, and uses Nico François'
reqtools.library (see the docs on how to set this up).
Yours,
Jim Finnis